<template>
  <div class="box">
      <div class="bg"><img class="auto-img" :src="songObj.coverImgUrl" alt=""></div>
    <div class="up_back" @click="backRanking">
      <img class="auto-img" src="../assets/back.png" alt="" />
    </div>
    <div class="coverImg">
      <img class="auto-img" :src="songObj.coverImgUrl" />
    </div>
    <div>
      <h5 class="songObjName">{{ songObj.name }}</h5>
      <div class="userInfo" v-if="songObj.creator">
        <img class="headSculpture" :src="songObj.creator.avatarUrl" />
        <span>{{ songObj.creator.nickname }}</span>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    songObj: Object,
  },
  methods: {
    backRanking() {
      this.$router.push({ path: "/" });
    },
  },
};
</script>

<style lang="less" scoped>
.auto-img {
  width: 100%;
  height: auto;
  display: block;
}
.box {
  padding: 30px 15px;
  width: 100%;
  display: flex;
  overflow: hidden;
  height: 200px;
  .up_back {
    width: 8vw;
    position: absolute;
    top: 0.2vh;
    left: 2vw;
  }
  .coverImg{
    width: 38vw;
  }
  h5 {
    color: white;
    margin-bottom: 20px;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  
  & > div:last-of-type {
    display: flex;
    flex-direction: column;
    margin-left: 15px;
  }
  .userInfo{
    display:flex;
    align-items: center;
    margin-left:3vw;
    .headSculpture {
      width: 6.5vw;
      height: 6.5vw;
      border-radius: 50%;
      margin-right: 2vw;
      display: block;
    }
    span {
      color: #c9c7c5;
      font-size: 14pz;
      align-self: start;
    }
  }
}
  .bg {
    width: 100vw;
    height: 200px;
    filter: blur(20px) brightness(0.6);
    z-index: -1;
    transform: scale(1.8);
    position: fixed;
  }

</style>